<%--
 *
 * @author Shengzhao Li
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="commons/taglib-header.jsp" %>
<!DOCTYPE HTML>
<html>
<head>
    <title>首页</title>
    <link href="${contextPath}/static/bootstrap/css/bootstrap.min.css" rel="stylesheet"/>
    <link href="${contextPath}/static/bootstrap/css/bootstrap-table.css" rel="stylesheet"/>
</head>
<body>
<div class="row">
    <div class="col-lg-2 col-sm-3 sidebar column">
        <ul id="navleft" class="nav nav-pills nav-stacked">
        </ul>
    </div>

    <div class="col-lg-10 col-sm-9 main column">

        <h3 class="page-header">用户管理</h3>
        <div class="pull-right">
            <a href="/user/create" class="btn btn-success"><em class="glyphicon glyphicon-plus"></em>创建用户></a>
        </div>
        <form action="" class="form-inline" id="filterForm">
            <div class="form-group">
                <input type="text" class="form-control" placeholder="用户名" name="username"
                       value="${paginated.username}"/>
            </div>
            <button type="submit" class="btn btn-default">
                <em class="glyphicon glyphicon-search"></em>
            </button>
            &nbsp;
            <span class="text-info">总数: ${paginated.totalSize}</span>
        </form>
        <br/>

        <dis:table list="${paginated}" id="d" form="filterForm" class="table table-striped table-hover table-bordered">
            <dis:column property="uuid" title="唯一标识"/>
            <dis:column property="username" title="用户名"/>
            <dis:column property="privileges" title="权限" />
            <dis:column property="createTime" title="创建时间" />

            <dis:column title="操作">
                <a class="btn btn-link btn-sm" href="details_${d.uuid}">编辑</a>
                <a class="btn btn-link btn-sm" href="delete_${d.uuid}" onclick="return confirm('确认删除')">删除</a>
                <a class="btn btn-link btn-sm" href="resetpassword_${d.uuid}"
                   onclick="return confirm('确认重置密码')">重置密码</a>
            </dis:column>
        </dis:table>

        <tags:paginated_select paginated="${paginated}"/>
    </div>
</div>
</body>
</html>
